<?php

/**
 * ExtObservableBase class file
 *
 * @author TrueSoftware B.V. (The Netherlands)
 * @link http://www.ext4yii.com
 * @copyright Copyright 2007-2010 TrueSoftwareB.V. all rights reserved.
 * @license http://www.ext4yii.com/license/
 *          EVALUATION VERSION - NOT FOR COMMERCIAL USE OR DISTRIBUTION.
 * @version 0.7.2
 */
class ExtComponentBase extends ExtObservable
{

    protected $_plugin_class_types = array('ExtPluginItem', 'ExtDeclaredPluginItemBase');

    public function parseNode(ExtHTMLParserNode $node, ExtASTWalker $astwalker)
    {
        parent::parseNode($node, $astwalker);
        $this->parsePlugins($node, $astwalker);
        $this->parseContextMenu($node, $astwalker);
    }

    private function parsePlugins($node, $astwalker)
    {
        $pitems = $node->findPropertyByName('plugins');
        if (!is_null($pitems))
        {
            $items = parent::parseNodeWidthTag($pitems,
                            $astwalker,
                            true,
                            array('asobject' => true),
                            $this,
                            $this->_plugin_class_types);

            if (count($items) != 0)
                $this->addedPlugins = array_merge($this->addedPlugins, $items);
            $pitems->shiftUp();
        }

        if (count($this->addedPlugins) != 0)
        {
            $this->setArrayConfig('plugins', $this->addedPlugins);
        }
    }

}

?>
